/**
 * @Author：ming
 * @Date：2023/10/2 9:39 PM
 * @Filename：Hj8
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author ming
 */
public class Hj15 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str ;
        while ((str=br.readLine())!=null){
            int n = Integer.valueOf(str);
            int count = 0;
            for (int i = 0; i < 32; i++) {
                if((n&1)==1){
                    count++;
                }
              n=  n>>>1;
            }
            System.out.println(count);
        }
    }
}
